-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(v2): switch to generated fetch API stub #64
Conversation
80effcc
to
03ef7c6
Compare
435f876
to
a6210e3
Compare
Signed-off-by: Tomas Pilar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firstly fix the warnings / errors from pipelines.
ping @pilartomas |
Almost all the client functionality is yet to be added in the followup PR. Fixing the pipelines really means removing most of the tests and examples. I wanted to avoid this given they are likely to be reintroduced in that PR. Do you really want them out? |
I see, then what about changing the target brain from |
Signed-off-by: Tomas Pilar <[email protected]>
This PR kicks off implementation of v2 client by establishing a new, long-lived branch and reworking the way API requests are made. Note that the overall design decision is to make the client thinner.
Below is the list of the most important changes:
axios
is replaced bycross-fetch
wrapped with strongly-typed API client stub generated from the OpenAPI schemafetch-retry
,promise-retry
wasn't really pluggable into the stub system.RequestError
has been made abstract. New, more specific,NetworkError
has been added andRequestCanceledError
has been removed entirely as the user supplying theAbortSignal
should be able to handle the abort error.Parameters<typeof client.models>
,Awaited<ReturnType<typeof client.models>>
). We are open to reintroducing them if this proves to be insufficient.v16
has been dropped, we're now targetingv18.12.0
and higher. This is to properly support Lanchain and Fetch utilities in the generated code. Note that we could still make it work with Nodev16
if there will be complaints from users.zod
schemas have been dropped as it's maintenance would require huge effort and it would duplicate type generation.